package avicit.bdp.dms.tdm.dto;

import avicit.bdp.common.base.BaseDTO;
import avicit.platform6.core.annotation.log.FieldRemark;
import avicit.platform6.core.annotation.log.LogField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.StringUtils;

import javax.persistence.Column;
import javax.persistence.Table;
import javax.persistence.Transient;

@ApiModel(value = "BdpAssetMountFileDTO", description = "资产挂载文件")
@Table(name = "bdp_asset_mount_file")
public class BdpAssetMountFileDTO extends BaseDTO {
  private static final long serialVersionUID = 1L;

  /** 主键ID */
  @LogField
  @ApiModelProperty(value = "主键")
  @FieldRemark(column = "id", field = "id", name = "主键")
  @Column(name = "id")
  @avicit.platform6.core.annotation.log.Id
  @javax.persistence.Id
  private String id;

  /** 数据资产id */
  @LogField
  @ApiModelProperty(value = "数据资产id", name = "assetId")
  @FieldRemark(column = "asset_id", field = "assetId", name = "数据资产id")
  private String assetId;

  /** 资源类型[1-数据服务/2-文档/3-报表分析/4-模型] */
  @LogField
  @ApiModelProperty(value = "资源类型[1-数据服务/2-文档/3-报表分析/4-模型]", name = "assetType")
  @FieldRemark(column = "asset_type", field = "assetType", name = "资源类型[1-数据服务/2-文档/3-报表分析/4-模型]")
  private String assetType;

  /** 数据源id[ftp/hdfs/oss类型] */
  @LogField
  @ApiModelProperty(value = "数据源id[ftp/hdfs/oss类型]", name = "datasourceId")
  @FieldRemark(column = "datasource_id", field = "datasourceId", name = "数据源id[ftp/hdfs/oss类型]")
  private String datasourceId;

  /** 项目空间ID */
  @LogField
  @ApiModelProperty(value = "项目空间ID", name = "projectId")
  @FieldRemark(column = "project_id", field = "projectId", name = "项目空间ID")
  private String projectId;

  /** 文件列表 */
  @LogField
  @ApiModelProperty(value = "文件列表", name = "files")
  @FieldRemark(column = "files", field = "files", name = "文件列表")
  private String files;

  /** 开放服务类型[1-数据查询/2-数据推送/3-API接口/4-下载/5-模型/6-报表] */
  @LogField
  @ApiModelProperty(
      value = "开放服务类型[1-数据查询/2-数据推送/3-API接口/4-下载/5-模型/6-报表]",
      name = "openServiceType")
  @FieldRemark(
      column = "open_service_type",
      field = "openServiceType",
      name = "开放服务类型[1-数据查询/2-数据推送/3-API接口/4-下载/5-模型/6-报表]")
  private String openServiceType;

  @Transient
  private String projectName;

  public String getId() {
    return id;
  }

  public void setId(String id) {
    this.id = id;
  }

  public String getAssetId() {
    return assetId;
  }

  public void setAssetId(String assetId) {
    this.assetId = assetId;
  }

  public String getAssetType() {
    return assetType;
  }

  public void setAssetType(String assetType) {
    this.assetType = assetType;
  }

  public String getDatasourceId() {
    return datasourceId;
  }

  public void setDatasourceId(String datasourceId) {
    this.datasourceId = datasourceId;
  }

  public String getFiles() {
    return files;
  }

  public void setFiles(String files) {
    this.files = files;
  }

  public String getOpenServiceType() {
    return openServiceType;
  }

  public void setOpenServiceType(String openServiceType) {
    this.openServiceType = openServiceType;
  }

  public String getProjectId() {
    return projectId;
  }

  public void setProjectId(String projectId) {
    this.projectId = projectId;
  }

  public String getProjectName() {
    return projectName;
  }

  public void setProjectName(String projectName) {
    this.projectName = projectName;
  }

  public String getLogFormName() {
    if (StringUtils.isEmpty(super.logFormName)) {
      return "资产-文件";
    } else {
      return super.logFormName;
    }
  }

  public String getLogTitle() {
    if (StringUtils.isEmpty(super.logTitle)) {
      return "资产-文件";
    } else {
      return super.logTitle;
    }
  }
  
}
